package com.jams.goodox.activity.mine.settings;

import android.view.View;
import android.widget.ImageView;

import com.jams.goodox.BaseActivity;
import com.jams.goodox.BuildConfig;
import com.jams.goodox.R;
import com.jams.goodox.utils.StyleUtil;

import butterknife.Bind;
import butterknife.OnClick;
import uama.share.ShareView;

/**
 * 邀请家人邻居
 */
public class InviteActivity extends BaseActivity {

    @Bind(R.id.img_code)
    ImageView imgCode;
    @Bind(R.id.my_share)
    ShareView shareHelp;
    String msg_qq = "我正在使用"+ BuildConfig.APP_NAME+"App-最领先的物业服务";
    String msg = String.format("【%s】我正在使用%sApp-最领先的物业服务软件，手机随身带，服务伴我行，%s业主独享，你也赶紧试试！下载地址：%s", BuildConfig.APP_NAME, BuildConfig.APP_NAME, BuildConfig.APP_NAME, BuildConfig.DOWNLOAD_IOS_ANDROID);

    @Override
    protected int getLayoutId() {
        return R.layout.invite;
    }

    @Override
    protected void init() {
        StyleUtil.titleBackKey(this, "邀请家人邻居");
        initShareContent();
    }

    private void initShareContent(){
        shareHelp.setDefaultLinkWithMsg(mContext.getString(R.string.app_send_msg),msg_qq, BuildConfig.DOWNLOAD_IOS_ANDROID,R.mipmap.icon_share_btn,msg);
    }

    @OnClick({R.id.ll_invite})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.ll_invite:
                shareHelp.setVisibility(View.VISIBLE);
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        if(shareHelp.getVisibility()==View.GONE)finish();
        else shareHelp.setVisibility(View.GONE);
    }

}
